package com.itheima.demo05;

public class MathDemo {

    public static void main(String[] args) {
        //public static int abs(int a) 返回参数的绝对值
        System.out.println(Math.abs(-1));

        //public static double ceil(double a) 返回大于或等于参数的最小整数
        System.out.println(Math.ceil(24.67));

        //public static double floor(double a) 返回小于或等于参数的最大整数
        System.out.println(Math.floor(23.69));

        //public static int round(float a)按照四舍五入返回最接近参数的int
        System.out.println(Math.round(24.23));
        System.out.println(Math.round(24.89));

        //public static int max(int a,int b) 获取两个int值中的较大值
        System.out.println(Math.max(23,45));

        //public static int min(int a,int b) 获取两个int值中的较小值
        System.out.println(Math.min(12,34));

        //public static double pow (double a,double b)计算a的b次幂的值
        System.out.println(Math.pow(3,4));

        //public static double random() 返回一个[0.0,1.0)的随机值
        System.out.println(Math.random());
        
    }
}
